<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // for in 不推荐遍历数组
    let obj = {
      uname: 'pink',
      age: 20,
      gender: '男'
    }
    // 遍历对象
    for (let k in obj) {
      console.log(k) // 属性名
      console.log(obj[k])


    }

  </script>
</body>

</html>